package com.atguigu.yygh.rabbit.service;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author luoyin
 * @Date 16:12 2022/10/10
 **/
@Component
public class MqService {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public boolean sendMessage(String exchange , String routerKey , Object message){
        rabbitTemplate.convertAndSend(exchange, routerKey, message);
        return true;
    }
}
